<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Option extends Model
{   
    protected $table = 'options';
    //
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name',
        'code',
        'currency_name', //货币名称
        'currency_unit', //货币单位
        'exchange_rate', //货币汇率
        'fluctuation',   //最小波动值
        'fluctuation_price', //最小波动价格
        'surplus_value',    //止盈值
        'stop_loss_value',  //止损值
        'stop_loss_margin', //止损保证金
        'transaction_cost', //综合交易费
        'hand_count',
        'times',
        'timesdescription',
        'description',
        'rules',
        'status',
        'icon',
        'sort'
    ];

    public function status(){
        $status = ['未开启','进行中','休市中'];
        return $status[$this->status];
    }
    public function statuslabel(){
        $status = ['label-danger','label-success','label-primary '];
        return $status[$this->status];
    }

}
